package com.baidu.dao.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.orm.hibernate3.HibernateTemplate;
import org.springframework.transaction.annotation.Transactional;

import com.baidu.dao.IUserDAO;
import com.baidu.entity.User;

public class UserDAO implements IUserDAO {
	
	@Autowired
	HibernateTemplate hibernateTemplate;

	@Override
	@Transactional
	public List<User> findAll() {
		return hibernateTemplate.find("from com.baidu.entity.User");
	}
	
	@Override
	@Transactional
	public void save(User user){
		hibernateTemplate.save(user);
	}
}
